{
语法百题 解题报告：
 http://git.oschina.net/et0662/sznoi-grammar/ 
}
var
	a:integer=0;
	b:integer=0;
	c:integer=0;
	t:char;
begin
	read(t);
	while(t<>'?')do
	begin
		case t of
		'a'..'z','A'..'Z':inc(a);
		'0'..'9':inc(b);
		else inc(c);
		end;
		read(t);
	end;
	writeln(a);
	writeln(b);
	writeln(c);
end.
